home *** CD-ROM | disk | FTP | other *** search
- Path: keats.ugrad.cs.ubc.ca!not-for-mail
- From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
- Newsgroups: comp.lang.c
- Subject: Re: bitfields, how big can their elements be?
- Date: 12 Mar 1996 09:28:45 -0800
- Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
- Message-ID: <4i4c8dINNsde@keats.ugrad.cs.ubc.ca>
- References: <4i2lab$ili@hobbes.cc.uga.edu> <TANMOY.96Mar12075107@qcd.lanl.gov>
- NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
-
- In article <TANMOY.96Mar12075107@qcd.lanl.gov>,
- Tanmoy Bhattacharya <tanmoy@qcd.lanl.gov> wrote:
- >In article <4i2lab$ili@hobbes.cc.uga.edu>
- >greear@pollux.cs.uga.edu (Ben Greear) writes:
- >
- >BG:
- >BG: Ok, i have a question on bitfields.... How big can their members be,
- >
- >Eacm member is valid if its width is smaller than or equal to the
- >number of bits in an ordinary object of the corresponding type,
- >i.e. the number of bits in an int. This number may vary from
- >implementation to implementation, but is guaranteed to be at least 16.
-
- With GCC I tried making bitfields "long" and "short". This is an odd locution;
- the compiler will actually prevent a "short" field from being more than 16
- bits, but long can be 32. It's strange that the GNU compiler allows these
- modifiers for bitfields! I'm going to have to look this up in the standard the
- first chance I get.
- --
-
-